<template>
  <div class="not-find-box">
    <div class="not-find-img"></div>
    <h1>页面不存在或者没有权限访问</h1>
    <h2 class="backtext">即将在 {{ backSeconds }} 秒后返回上一页</h2>
  </div>
</template>

<script>
export default {
  name: 'notFind',
  data() {
    return {
      backSeconds: 3,
      times: null
    }
  },
  mounted() {
    this.times = setInterval(() => {
      this.backSeconds--
      if (this.backSeconds <= 0) {
        clearInterval(this.times)
        window.history.length > 1 ? this.$router.go(-1) : this.$router.push('/login')
      }
    }, 1000)
  },
  beforeUnmount() {
    clearInterval(this.times)
  }
}
</script>

<style scoped>
.not-find-box {
  font-size: 16px;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  /* margin: 0px auto 0px; */
  /* background: url('../assets/images/noFind/404-01.svg') no-repeat center; */
  /* background-size: 100% 100%; */
  box-sizing: border-box;
}
.not-find-img {
  width: 360px;
  height: 310px;
  /* background: url('@/assets/images/noFind/404-01.svg') no-repeat center; */
  margin: 0px auto 0px;
  background-size: cover;
}
.backtext {
  margin-top: 10px;
}
</style>
